package com.oepm.biz.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.oepm.biz.ApplyVerifyBiz;
import com.oepm.dao.entity.EstabStuInfoPo;
import com.oepm.dao.entity.QueryInfo;
import com.oepm.dao.entity.StuDemoFormPo;
import com.oepm.dao.entity.vo.StuOneVo;
import com.oepm.dao.mapper.ApplyVerifyMapper;
import com.oepm.vo.DataVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class ApplyVerifyBizImpl implements ApplyVerifyBiz {

    @Resource
    private ApplyVerifyMapper applyVerifyMapper;

    //审核查询，查所有
    @Override
    public DataVo queryForms(@Param("userId") String userId, QueryInfo queryInfo){

        PageHelper.startPage(queryInfo.getPagenum(),queryInfo.getPagesize());
        List<StuDemoFormPo> stuDemoFormPos = applyVerifyMapper.queryForms(userId);
        PageInfo<StuDemoFormPo> pi = new PageInfo<>(stuDemoFormPos);
        return new DataVo(pi.getTotal(),pi.getList());


    }

    @Override
    public List<StuDemoFormPo> queryFormByUsername(Map<String, String> map) {
        return applyVerifyMapper.queryFormByUsername(map);
    }

    @Override
    public int updateTeaView(StuDemoFormPo stuDemoFormPo) {
        return applyVerifyMapper.updateTeaView(stuDemoFormPo);
    }

    @Override
    public String selectMajor(String pid) {
        return applyVerifyMapper.selectMajor(pid);
    }

    @Override
    public int updateEstabMajor(EstabStuInfoPo info) {
        return applyVerifyMapper.updateEstabMajor(info);
    }

    @Override
    public int updateStuOne(StuOneVo stuOneVo) {
        return applyVerifyMapper.updateStuOne(stuOneVo);
    }

    @Override
    public int updataEstabStuOne(StuOneVo stuOneVo) {
        return applyVerifyMapper.updataEstabStuOne(stuOneVo);
    }

    @Override
    public String selectStus(String pid) {
        return applyVerifyMapper.selectStus(pid);
    }

    @Override
    public int updateStuNum(EstabStuInfoPo info) {
       return applyVerifyMapper.updateStuNum(info);
    }
    @Override
    public int updateStuName(EstabStuInfoPo info) {
        return applyVerifyMapper.updateStuName(info);
    }

    @Override
    public List<StuOneVo> selectStuOnes(String pid) {
        return applyVerifyMapper.selectStuOnes(pid);
    }

    @Override
    public int deleteStuOne(Integer id) {
        return applyVerifyMapper.deleteStuOne(id);
    }

}
